package com.wiscamp.ninechapters.problems.infrastructure.po.types;

import com.wiscamp.ninechapters.ddd.PersistenceObject;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * 题型
 */
@Entity
@Data
@Table(name = "problem_types_view")
@EqualsAndHashCode
public class ProblemTypeView implements PersistenceObject {
    @Serial
    private static final long serialVersionUID = 5335327358748230493L;

    /**
     * 题型编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(insertable = false, name = "type_id", nullable = false)
    private long typeId = 0;


    /**
     * 学科编号
     */
    @Column(name = "subject_id", nullable = false)
    private long subjectId = 0;

    /**
     * 题型代码
     */
    @Column(name = "type_code", nullable = false)
    private String typeCode = "";

    /**
     * 题型名称
     */
    @Column(name = "type_name", nullable = false)
    private String typeName = "";

    /**
     * 题型说明
     */
    @Column(name = "type_description", nullable = false)
    private String typeDescription = "";

    /**
     * 题型说明语音
     */
    @Column(name = "type_audio")
    private String typeAudio = "";

    /**
     * 是否有题干部分
     */
    @Column(name = "has_stem", nullable = false)
    private boolean hasStem = false;

    /**
     * 题干标题
     */
    @Column(name = "stem_title")
    private String stemTitle = "";

    /**
     * 题干子标题
     */
    @Column(name = "stem_subtitle")
    private String stemSubtitle = "";

    /**
     * 题干类型
     */
    @Column(name = "stem_type_id")
    private int stemTypeId = 0;

    /**
     * 题干语音播放次数
     */
    @Column(name = "stem_play_times")
    private int stemPlayTimes = 0;

    /**
     * 题模式
     */
    @Column(name = "problem_mode_id", nullable = false)
    private int problemModeId = 0;

    /**
     * 通用问题模式
     */
    @Column(name = "common_question_mode_id", nullable = false)
    private int commonQuestionModeId = 0;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark = "";

    /**
     * 是否可用
     */
    @Column(name = "is_active", nullable = false)
    private boolean enabled = true;

    /**
     * 是否删除
     */
    @Column(name = "is_deleted", nullable = false)
    private boolean deleted = false;

    /**
     * 创建用户
     */
    @Column(name = "created_by", nullable = false)
    private long creatorId = 0;

    /**
     * 创建时间
     */
    @Column(name = "created_time", nullable = false)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    @Column(name = "modified_by")
    private long modifierId = 0;

    /**
     * 编辑时间
     */
    @Column(name = "modified_time")
    private LocalDateTime modificationTime;

    @Column(name = "subject_name")
    private String subjectName = "";

    @Column(name = "stem_type_name")
    private String stemTypeName = "";

    @Column(name = "problem_mode_name")
    private String problemModeName = "";

    @Column(name = "common_question_mode_name")
    private String commonQuestionModeName = "";

    @Column(name = "creator_name")
    private String creatorName = "";

    @Column(name = "modifier_name")
    private String modifierName = "";
}